package IC.Parser;

import java_cup.runtime.Symbol;

public class Token extends Symbol {

	private int line;
	private Object value;
	private String idName;

	public Token(int id, Object value, int line, String idName) {
		super(id, value);
		this.line = line;
		this.idName = idName;
		this.value = value;
	}

	public Token(int id, int line, String idName) {
		this(id, null, line, idName);
	}

	public int getLine(){
		return line;
	}
	
    @Override
	public String toString(){

		StringBuffer buffer = new StringBuffer();
		buffer.append(idName);
		if (value != null){
			buffer.append("(");
			buffer.append(value);
			buffer.append(")");
		}

		return buffer.toString();
	}

}

